//package com.bosssoft.code.service.manage.rule.impl;
//
//import com.bosssoft.code.data.dao.mapper.TableAssociationInfoMapper;
//import com.bosssoft.code.data.dao.mapper.TableBasicInfoMapper;
//import com.bosssoft.code.data.dao.mapper.TableFieldInfoMapper;
//import com.bosssoft.code.data.dao.mapper.TableGenerateInfoMapper;
//import com.bosssoft.code.data.pojo.dto.TableAllInfoDto;
//import com.bosssoft.code.data.pojo.entity.TableAssociationInfo;
//import com.bosssoft.code.data.pojo.entity.TableBasicInfo;
//import com.bosssoft.code.data.pojo.entity.TableFieldInfo;
//import com.bosssoft.code.data.pojo.entity.TableGenerateInfo;
//import com.bosssoft.code.util.AnalyseSqlUtil;
//import com.bosssoft.code.util.IdGeneratorUtil;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import java.util.HashMap;
//
//@Service
//public class TableServiceImpl {
//
//    @Autowired
//    private TableBasicInfoMapper tableBasicInfoMapper;
//    @Autowired
//    private TableFieldInfoMapper tableFieldInfoMapper;
//    @Autowired
//    private TableAssociationInfoMapper tableAssociationInfoMapper;
//    @Autowired
//    private TableGenerateInfoMapper tableGenerateInfoMapper;
//
//    public boolean addTableInfo(TableAllInfoDto tableAllInfoDto) {
//        return true;
//    }
//
//    public boolean analyseTableInfo(String sql) {
//        AnalyseSqlUtil analyseSqlUtil = new AnalyseSqlUtil(sql);
//        HashMap<String,Object> map = analyseSqlUtil.analyseSqlUtil(sql);
//        IdGeneratorUtil idGeneratorUtil = new IdGeneratorUtil();
//        TableAllInfoDto tableAllInfoDto = new TableAllInfoDto();
//        TableBasicInfo tableBasicInfo = new TableBasicInfo();
//        TableAssociationInfo tableAssociationInfo = new TableAssociationInfo();
//        TableGenerateInfo tableGenerateInfo = new TableGenerateInfo();
//
//        tableBasicInfo.setId(idGeneratorUtil.snowflakeId());
//        tableAssociationInfo.setId(idGeneratorUtil.snowflakeId());
//        tableGenerateInfo.setId(idGeneratorUtil.snowflakeId());
//
//        tableAssociationInfo.setTableId(tableBasicInfo.getId());
//        tableGenerateInfo.setTableId(tableBasicInfo.getId());
//
//        tableBasicInfo.setName((String) map.get("tableName"));
//        tableBasicInfo.setDescription((String) map.get("tableDescription"));
//
//        tableBasicInfoMapper.addTableBasicInfo(tableBasicInfo);
//        tableAssociationInfoMapper.addTableAssociationInfo(tableAssociationInfo);
//        tableGenerateInfoMapper.addTableGenerateInfo(tableGenerateInfo);
//        tableAssociationInfoMapper.addTableAssociationInfo(tableAssociationInfo);
//
//        TableFieldInfo tableFieldInfo = new TableFieldInfo();
//        tableFieldInfo.setId(idGeneratorUtil.snowflakeId());
//        tableFieldInfo.setTableId(tableBasicInfo.getId());
//        return true;
//    }
//}
